/**
 * FieldProtocol.java
 * 卢晓峰
 * Email：lxf9601@gmail.com
 * QQ 297051898
 * Created by 2010-6-6
 */
package com.autoabacus.core.config.protocol;

/**
 * 字段配置协议
 * @author 卢晓峰
 */
public class FieldProtocol {
	
	public class Attribute {
		public static final String NAME = "name";		
		public static final String ALIAS = "alias";
		public static final String PRIMARY_KEY = "primaryKey";
		public static final String DATA_TYPE = "dataType";
		public static final String LINK = "link";
		public static final String REF = "ref";
		public static final String VIEW_STRATEGY = "viewStrategy";
		public static final String QUERY_STRATEGY = "queryStrategy";
		public static final String SORT_INDEX = "sortIndex";
		public static final String DICTIONARY_NAME = "dictionaryName";
	}
	
	/**
	 * 字段数据类型
	 */
	public enum DataType {
		STRING,
		INTEGER,
		LONG,
		FLOAT,
		DOUBLE,
		DATE,
		DATETIME,
		BOOLEAN
	}
	/**
	 *  显示策略
	 */
	public enum ViewStrategy {
		SHOW,
		NONE
	}
	
	/**
	 * 查询策略
	 */
	public enum QueryStrategy {
		/** 不做为查询条件*/
		NONE,
		
		/** 布尔类型精确匹配 */
		BOOLEAN_EXACT,
		
		/** 字符串精确匹配*/
		STRING_EXACT,
		
		/** 字符串模糊匹配*/
		STRING_LIKE,
		
		/** 字符串多个同时匹配*/
		STRING_MULTI,
		
		/** 整型精确查询 */
		INT_EXACT,
		
		/** 整型多个同时匹配 */
		INT_MULTI,
		
		/** 整型范围匹配 */
		INT_BETWEEN,
		
		/** 长整数精确匹配*/
		LONG_EXACT,
		
		/** 长整数范围匹配*/
		LONG_BETWEEN,
		
		/** 双精度范围匹配*/
		DOUBLE_BETWEEN,
		
		/** 单精度范围匹配*/
		FLOAT_BETWEEN,
		
		/** 短日期精确匹配*/
		DATE_EXACT,
		
		/** 短日期范围匹配*/
		DATE_BETWEEN,
		
		/** 长日期范围匹配*/
		DATETIME_BETWEEN
	}
}
